package com.play.ballen.synthetic.adapter

import android.widget.TextView
import androidx.core.content.ContextCompat
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.play.ballen.R
import com.play.ballen.synthetic.entity.Guess
import com.play.ballen.synthetic.entity.SyntheticRecordInfo
import com.yuven.baselib.utils.ResourceUtil

class SyntheticNewRecordAdapter(data: MutableList<Guess>) :
    BaseQuickAdapter<Guess, BaseViewHolder>(R.layout.item_synthetic_new_record, data) {

    override fun convert(holder: BaseViewHolder, item: Guess) {
        holder.setText(R.id.tvNumberValue, item.guess_number)
        holder.setText(R.id.tvTimeValue, item.add_time)
        holder.setText(R.id.tvTouzhuValue, item.pay_amount)

        val statusTextView = holder.getView<TextView>(R.id.tvStatusValue)

        if (item.status == 2) {
            statusTextView.text = ResourceUtil.getString(R.string.shu)
            statusTextView.setTextColor(ContextCompat.getColor(context, R.color.color_team_mission_incomplete))
        } else if(item.status == 1) {
            statusTextView.text = ResourceUtil.getString(R.string.ying)
            // 设置其他状态的文本颜色，可以根据需要设置为不同的颜色
            statusTextView.setTextColor(ContextCompat.getColor(context, R.color.green))
        }else {
            statusTextView.text = ResourceUtil.getString(R.string.daichujieguo)
            // 设置其他状态的文本颜色，可以根据需要设置为不同的颜色
            statusTextView.setTextColor(ContextCompat.getColor(context, R.color.green))
        }
    }

}